Skip to content

[docs] Use other checkpoints with inpaint#5590

Merged
stevhliu merged 4 commits into
huggingface:mainfrom
stevhliu:inpaint-checkpoints
Nov 13, 2023
Merged

[docs] Use other checkpoints with inpaint#5590
stevhliu merged 4 commits into
huggingface:mainfrom
stevhliu:inpaint-checkpoints

Conversation

@stevhliu
Copy link
Copy Markdown
Member

Adds a tip clarifying you can use non inpaint-specific checkpoints in the inpainting pipeline.

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented Oct 30, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Copy Markdown
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good if we can write a whole section about it here and also show how it differs, what options can be enabled by the user cc @yiyixuxu maybe you can help here a bit as well?

@stevhliu
Copy link
Copy Markdown
Member Author

stevhliu commented Nov 8, 2023

I expanded more on the section to show how quality differs for more basic vs complex tasks. Feel free to add anything I may have missed @yiyixuxu 🙏

Copy link
Copy Markdown
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

I think we should talk about the other side of trade-off here. Basically the official in-paint pipeline has better generation qualities but it is less "respectful" to the mask. It means that it's much more willing to change the content around the mask edge in order to generate a better looking image. If you want your unmasked area fixed, you can't use the official inpaint pipeline

on the other hand, if we use our regular test-to-image unet to generate inpaint. at each denoising step, we will paste over the original image latent to the unmasked area, so it is more respectful to the mask, so much so that you often can see the mask edge. And the overall image is less natural. But if you need to have your unmaksed area fixed, you can only achieve that with non-inpaint specific checkpoint. (we have code in the doc that teaches how to do that I think). and this PR may give you a little bit more info on this #3880

Copy link
Copy Markdown
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, but agree with Yiyi

@stevhliu
Copy link
Copy Markdown
Member Author

Thanks for the excellent explanation @yiyixuxu 🙇‍♂️ , updated the docs to discuss the trade-off and merged the "preserve unmasked areas" code with this section

@stevhliu stevhliu requested a review from yiyixuxu November 13, 2023 19:06
Copy link
Copy Markdown
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great:) thank you

@stevhliu stevhliu merged commit 4b45a1e into huggingface:main Nov 13, 2023
@stevhliu stevhliu deleted the inpaint-checkpoints branch November 13, 2023 20:39
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* tip about inpaint checkpoints

* expand section

* feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants